var stageTemplate = `
<div class="weui-cells">
    <div class="weui-cell" v-for="eObject in credit">
    <div class="weui-cell__hd"><div style="width:20px;margin-right:5px;display:block"></div></div>
        <div class="weui-cell__bd">
            <p class="number">{{ eObject.total | currency('') }}</p>
            <p class="cell_explain">本金：<span class="number">{{ eObject.principal | currency('') }}</span> + 手续费：<span class="number">{{ eObject.brokerage }}</span></p>
        </div>
        <div class="weui-cell__ft">
        <p class="cell_explain">第<span class="number">{{ eObject.stageNum }}</span>期</p>
        <p class="cell_explain"><span class="number">{{ eObject.repayDate }}</span></p>
        </div>
    </div>
    <div id="payment-speed" class="payment-cell"></div>
</div>
`;

function getRepayCells(repayData) {

    return {
        template: stageTemplate,

        computed: {

        },
        methods: {

        },
        props: ['credit'],
        mounted: function() {
            setRepayBoxHeight();
        }
    };
}

// 设置还款列表的父元素高度
function setRepayBoxHeight() {
    var wh = window.innerHeight;
    var rbh = (wh - 100 - 101 - 46 - 60) + "px";
    $("#repay_box").css("height", rbh);
}

module.exports = {
    getRepayCells: getRepayCells
}
